﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Microsoft.Reporting.WebForms;

namespace App.Views.VehicleService
{
    public partial class PrintBill : System.Web.Mvc.ViewPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                ReportViewer1.LocalReport.ReportPath = Server.MapPath("~/Views/VehicleService/rptVehicleBill.rdlc");
                ReportDataSource datasource = new ReportDataSource();
                datasource.Name = "dsUseVehicle";              
                string id = Request.QueryString["id"];
                datasource.Value = App.Models.ReportClass.GetUseVehicleRecord(id);
                ReportViewer1.LocalReport.DataSources.Add(datasource);
            } 
        }
    }
}